package com.tencent.sr.iris.basic.saas.service.model.advisor;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.tencent.sr.iris.activity.interfaces.response.group.GroupTaskBoardSecondResponse;
import com.tencent.sr.iris.activity.interfaces.response.group.operate.OperateThirdBoardResponse;
import com.tencent.sr.iris.basic.saas.common.enums.IrisOrderStatusEnum;
import com.tencent.sr.iris.basic.saas.common.enums.IrisTaskProfitStatusEnum;
import com.tencent.sr.iris.basic.saas.common.utils.BizUtil;
import com.tencent.sr.iris.basic.saas.common.utils.CommonUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Data
@ApiModel(value = "导师视角三级页面-(特邀会员冲刺赛)导出信息")
@Slf4j
@ColumnWidth(15)
public class AdvisorThirdBoardSpecialSprintExportInfo {
    @ExcelProperty(value = "序号", index = 0)
    private int num;

    @ExcelProperty(value = "是否有效", index = 1)
    private String isValid;

    @ExcelProperty(value = "uid", index = 2)
    private String irisUid;

    @ExcelProperty(value = "union ID", index = 3)
    private String wechatUserUnionid;

    @ExcelProperty(value = "昵称", index = 4)
    private String wechatUserNickname;

    @ExcelProperty(value = "下单时间", index = 5)
    private String thirdPartOrderCreateTime;

    @ExcelProperty(value = "订单状态", index = 6)
    private String orderStatus;

    @ExcelProperty(value = "订单金额", index = 7)
    private Double validGmv;

    @ExcelProperty(value = "预估佣金", index = 8)
    private Double commissionBillCommissionFee;

    @ExcelProperty(value = "订单编号", index = 9)
    private String plainOrderId;

    @ExcelProperty(value = "收益状态", index = 10)
    private String commissionStatus;

    public void readFromSearchResponseData(GroupTaskBoardSecondResponse response) {
        this.setIsValid(BizUtil.getIsValid(response.getIsValid()));
        this.setIrisUid(response.getIrisUid());
        this.setWechatUserUnionid(response.getWechatUserUnionid());
        this.setWechatUserNickname(response.getWechatUserNickname());
        this.setThirdPartOrderCreateTime(response.getThirdPartOrderCreateTime());
        this.setOrderStatus(IrisOrderStatusEnum.getByStatus(response.getOrderStatus()));
        this.setValidGmv(CommonUtils.longToDouble(response.getValidGmv()));
        this.setCommissionBillCommissionFee(CommonUtils.longToDouble(response.getCommissionBillCommissionFee()));
        this.setPlainOrderId(response.getPlainOrderId());
        this.setCommissionStatus(IrisTaskProfitStatusEnum.getByStatus(response.getCommissionStatus()));
    }
}
